using Microsoft.AspNetCore.Mvc;

namespace Magic.Web.Entry;
/// <summary>
/// 消息发送控制器
/// </summary>
public class MessageController: BaseController
{
    private readonly IMessageService _messageService;
    public MessageController(IMessageService messageService)
    {
        _messageService=messageService;
    }
    /// <summary>
    /// 发送消息给所有人
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost("sendAllUser")]
    public async Task SendAllUser(MessageInput input)
    {
        await _messageService.SendAllUser(input);
    }
    /// <summary>
    /// 发送消息给除了发送人的其他人
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost("sendOtherUser")]
    public async Task SendOtherUser(MessageInput input)
    {
        await _messageService.SendOtherUser(input);
    }
    /// <summary>
    /// 发送消息给某个人
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost("sendUser")]
    public async Task SendUser(MessageInput input)
    {
        await _messageService.SendUser(input);
    }
    /// <summary>
    /// 发送消息给某些人
    /// </summary>
    /// <param name="input"></param>
    /// <returns></returns>
    [HttpPost("sendUsers")]
    public async Task SendUsers(MessageInput input)
    {
        await _messageService.SendUsers(input);
    }
}
